<?php
class Mahasiswa extends Model {
	function Mahasiswa(){
		parent::Model();
    }
    function isIlkomers($nim){
    	$result= array();

        $query = "SELECT * FROM mahasiswa WHERE nim='$nim' LIMIT 1";
    	$query = $this->db->query($query);
    	
    	if($query->result()){
    		foreach ($query->result() as $row){
  				$result ['email'] = $row->email;
  				$result ['nama']= $row->nama;
  				$result ['id']= $row->id;
			}
			$result['ok'] = TRUE;
    	}else{
    		$result['ok'] = FALSE;
    	}
        return json_encode($result);
    }
}